using usm.SolDev.Common.Config;

namespace usm.SolDev.Common
{
    
    public class ProcessCompile : ProcessRunner
    {

        #region Private data
        private CompilerConfig compilerConfig = new CompilerConfig();
        private string programDescription;

        #endregion

        #region Constructors
        /// <summary>
        ///     default constructor
        /// </summary>
        public ProcessCompile ()
        {
            string applicationPath = compilerConfig.ApplicationPath;

            compilerConfig = (CompilerConfig)compilerConfig.LoadFromFile();
            compilerConfig.ApplicationPath = applicationPath;

            base.Application = compilerConfig.CompilerPath;
            base.Arguments = compilerConfig.Arguments;
        }

        /// <summary>
        ///     Constructor for file compilation
        /// </summary>
        /// <param name="sourceFile">the file name</param>
        public ProcessCompile (string sourceFile) : this ()
        {
            // compilerConfig.SourceFile = sourceFile;
        }

        /// <summary>
        ///     Constructor for streaming compilation
        /// </summary>
        /// <param name="programLines"> </param>
        /// <param name="programDescription"> </param>
        /// <param name="execute"> </param>
        public ProcessCompile(string programLines, string programDescription, bool execute): 
            this ()
            
        {
            this.ProgramLines = programLines;
            this.programDescription = programDescription;
            base.Execute = execute;
            
        }
        #endregion

        #region Public properties

        /// <summary>
        ///     The program for which compilation is invoked
        /// </summary>
        public string ProgramLines { get; set; }

        #endregion
                
    }
}
